<template>
	<view class="user-address-page">
		<cover-image class="add-address" src="../../../static/images/users/add_address.png" @click="handleAdd"></cover-image>
		<view class="address-item" v-for="(addressItem, addressIndex) in list" :key="addressIndex">
			<image class="pre-icon" src="../../../static/images/users/pre_address.png"></image>
			<view class="info-box">
				<view class="text">{{addressItem.address}}</view>
				<view class="user">
					<view class="user-info">
						<view class="name">{{addressItem.user}}</view>
						<view class="phone">{{addressItem.phone}}</view>
					</view>
					<image class="edit-icon" src="../../../static/images/users/edit_address.png"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					{
						address: '河南省郑州市中原区三官庙街道西三环与建设西路交叉口',
						user: '陈(先生)',
						phone: '15478459877'
					},
					{
						address: '河南省郑州市中原区三官庙街道西三环与建设西路交叉口',
						user: '陈(先生)',
						phone: '15478459877'
					}
				]
			}
		},
		methods: {
			// 点击编辑地址
			handleEdit() {
				uni.navigateTo({
					url: '/pages/users/address/add'
				})
				
			},
			// 点击添加地址
			handleAdd() {
				uni.navigateTo({
					url: '/pages/users/address/add'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.user-address-page {
		.add-address {
			position: fixed;
			right: 22rpx;
			bottom: 528rpx;
			width: 90rpx;
			height: 90rpx;
		}
		.address-item{
			display: flex;
			flex-direction: row;
			justify-content: flex-start;
			align-items: flex-start;
			padding: 32rpx;
			background-color: #fff;
			margin-bottom: 20rpx;
			.pre-icon {
				width: 28rpx;
				height: 34rpx;
				margin-right: 22rpx;
			}
			.info-box {
				.text {
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #000000;
					padding-right: 58rpx;
					margin-bottom: 25rpx;
				}
				.user {
					display: flex;
					flex-direction: row;
					justify-content: space-between;
					align-items: center;
					.user-info {
						display: flex;
						font-size: 26rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #A6A6A6;
						.name {
							margin-right: 30rpx;
						}
					}
					.edit-icon {
						width: 34rpx;
						height: 34rpx
					}
				}
			}
		}
	}
</style>